<?php
/**
 * The main template file.
 *
 * This is the most generic template file in a WordPress theme
 * and one of the two required files for a theme (the other being style.css).
 * It is used to display a page when nothing more specific matches a query.
 * E.g., it puts together the home page when no home.php file exists.
 * Learn more: http://codex.wordpress.org/Template_Hierarchy
 *
 * @package WordPress
 * @subpackage Twenty_Ten
 * @since Twenty Ten 1.0
 */

get_header(); ?>
		<div id="container">
			<div id="content" role="main">
            <div class="cont_tit_cat">
				<h1 class="page-title"><?php
					printf( __( 'Archivos: %s', 'twentyten' ), '' . single_cat_title( '', false ) . '' );
				?></h1></div>
            	<div id="blogs">
                <?php
					$id_category_blogs = get_category_by_slug( 'blogs' )->term_id;
					$args = array('child_of' => $id_category_blogs);
                	$categories = get_categories( $args );
					foreach ($categories as $cat) {
						
											  if (function_exists('get_terms_meta')) {
        $metaValue = get_terms_meta($cat->cat_ID, 'imagen');
      }
					$category_description = category_description();
					if ( ! empty( $category_description ) )
						echo '<div class="cont_desc_cat">
						   		<div class="archive-meta">
							'.'<img width="120" height="120" title="' . single_cat_title( '', false ) . '" alt="" src="'.$metaValue[0].'" class="alignleft">' . $category_description . '</div></div>';

						
						
					}
				?> 
	    		</div><!-- #blogs -->
    		</div><!-- #content -->
			<?php get_sidebar(); ?>
		</div><!-- #container -->

<?php get_footer(); ?>
